export default {
    components: {},
    data() {
        return {
            queryParams:{},//主要用来存放列表接口的查询条件的参数
            PAGINATION: {
                pageSize: 10,
                currentPage: 1,
                total: 0,
                pageSizes: [1, 10, 20, 50, 100]
            },//是element-ui中分页组件（ el-pagination）的初始化参数
        }
    },
    methods: {
        // 分页长度改变
        handlePageSizeChange(pageSize) {
            this.PAGINATION = {
                ...this.PAGINATION,
                pageSize
            }
            this.loadTableData(this.queryParams)
        },
        //分页页码改变
        handlePageChange(currentPage) {
            this.PAGINATION = {
                ...this.PAGINATION,
                currentPage
            }
            this.loadTableData(this.queryParams)
        },
        getParams() {
            return {
                current: this.PAGINATION.currentPage,
                size: this.PAGINATION.pageSize,
            }
        }
    }
}